package com.gupao.javavip.quartz.job;

import com.gupao.javavip.quartz.dto.MessageDTO;
import com.gupao.javavip.quartz.service.MessageService;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author King
 * @Classname JobService
 * @Description
 * @Date 2020/5/1 17:20
 */
@Component
@CommonsLog
public class JobService {

    @Autowired
    private MessageService messageService;

    public void doJob() {
        List<MessageDTO> messageDTOList = messageService.queryMessage();
        int msgCount = messageDTOList.size();

        log.info("获取到[" + msgCount + "]条最新消息！");
    }
}
